package com.example.demouser.bizservice.impl;

import com.example.demouser.bizservice.TestBizService;
import com.example.demouser.bizservice.http.UserThirdService;
import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class TestBizServiceImpl implements TestBizService {
    /**
     * log
     */
    Logger logger = LoggerFactory.getLogger(TestBizServiceImpl.class);
    @Value("${server.port}")
    private String p;

    @Resource
    private UserThirdService userThirdService;

    public Map test() {
        logger.info("端口：--->" + p);
        long start = System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
        }
        Map<String, String> map = Maps.newConcurrentMap();
        map.put("a", "demo-user");
        long end = System.currentTimeMillis();
        map.put("total", (end - start) + "");
        map.put("port", p);
        //String result = userThirdService.getBaiDuIndex();
        return map;
    }
}
